1. Field of the Invention
The present invention relates to an image processing method and image processing apparatus in which infinite gradation images are quantized into several gradation levels.
2. Description of the Prior Art
With the spread of personal computers, the demand for printers has increased by leaps and bounds and the printers have been improved in picture quality in recent years. In ink jet printers, for example, full colors used to be expressed with respective colors processed in bi-levels, but now high picture quality can be obtained with multi-leveled (quantized into multi-levels) color processing. To express multi-leveled images with a small data size, it is common to make pseudo gradation by digital half-tone processing. The techniques often applied to achieve this pseudo gradation include the dithering method and the error diffusion method.
Among the pseudo gradation processing methods is the adjacent density integrated re-allocation method. Multi-leveling by this method is disclosed in Japanese Patent Publicized Gazette No. 7-93684. (Japanese Patent No. 2058828). (For further details, see Proceeding of the SID Vol. 32/2, 1991 P. 145-151.) In the adjacent density integrated re-allocation method, the adjacent density values (densities of the adjacent pixels around the object pixel) are first added up, and the value from the addition is re-allocated in a pixel with a high density, which makes letters and line drawings stand out.
FIG. 21 is a block diagram of the multi level correlative density assignment of adjacent pixels (CAPIX) method shown in FIG. 1 of Japanese Patent Publicized Gazette No. 7-93684.
An original image is scanned by original image scanning means G1, and thus image data is obtained (wherein image data is synonymous with density data). Storage means G6 for re-allocation stores the output data of this original image scanning means G1, that is, image data G11 of the original image and the output data of re-allocation means G9, that is, storage data G22 for re-allocation, which will be describe later, and then outputs image data G18 of a scanning window (a adjacent frame of specific pixels including the object pixel and input pixels).
Allocation value calculation means G7 adds up the output data of storage means G6 for re-allocation, that is, image data G18 of the scanning window and the output data of allocation error calculation means G8, that is, allocation error G20, which will be described later. Furthermore, allocation number N and residual A are found by dividing the addition result by gradation unit Cn. The gradation unit Cn becomes a value (in the case of n=4 in 8 bits, 85) obtained by dividing the maximum value of image signal (in the case of 8 bits, 255) by n−1 (n: number of gradations). Furthermore, half-valued gradation unit Cn/2, the gradation unit Cn halved, and the residual A are compared. When the residual A is equal or larger than the half-value, a corrected allocation number N+1 obtained by adding 1 to the allocation number N is outputted. In case the residual A is smaller than the half-valued image data, the allocation number N as it is outputted.
Meanwhile, the output data of original image scanning means G1, that is, image data G11 of the original image is also stored in storage means G4 for ranking, and this storage means G4 for ranking outputs image data of the scanning window. The picture image data G15 and neighborhood correction quantity G16, that is, the output of ranking correction means G3, which will be described later, are inputted to ranking means G5 where the image data of pixels in the scanning window are compared to decide on the pixel ranking.
In re-allocation means G9, the allocation number N (or N+1) and the number M of pixels in the scanning window are compared. When N (or N+1) is smaller than the number M of pixels in the scanning window, a specific gradation unit Cn and 0 are allocated to the position of respective pixels according to the ranking order. When N (or N+1) is equal to the number M of pixels, a specific gradation unit Cn is allocated to the position of respective pixels. And when N (or N+1) is larger than the number M of pixels, a specific gradation unit Cn is added and allocated to the position of respective pixels according to the ranking order.
In allocation error calculation means G8, an allocation error is worked out using the sum or the output of allocation value calculation means G7 and the residual A and allocation number N (or N+1), and the allocation error thus obtained is outputted. Furthermore, ranking correction means G3 outputs a neighborhood correction quantity G16 and new ranking correction quantity G13 with the following data as input: pixel data G14 of object pixel, the output data of storage means G6 for re-allocation, that is, multi-leveled data G23 of re-allocated pixels, and the output data of correction quantity storage means G2, which will be described later. Moreover, it is so arranged that the output signal of storage means G36 for re-allocation, that is, multi-leveled data G23 of the re-allocated pixels are inputted into image print/display means G10, which records or displays multi-leveled images.
A concrete example of the conventional multi-leveled or four-leveled (quantized into four levels) adjacent density integrated re-allocation method is shown in FIG. 22 in which two-column, two-row scanning windows are used. FIG. 22(a) shows part of the values obtained by original image scanning means G1 and stored in storage means G4 for ranking. The pixel at the upper left (column 1, row 1) is the object pixel, and pixel at the lower right corresponds to the input pixel. If the density value is expressed in four-leveled image data from “0” to “255,” gradation unit Cn is “85” which is obtained by dividing “255” by (4−1), that is, “3.” The density values in the scanning window ranked by ranking means G5 are shown in FIG. 22(b). It is noted that for purpose of simplicity, the neighborhood correction quantity outputted from ranking correction means G3 is ignored. The data stored in storage means G6 for re-allocation is shown in FIG. 22(c). The image data value at the lower right “70” is a newly inputted value.
If it is assumed that the allocation error value G20 of the previous pixel outputted from allocation error calculation means G8 is “20” and put to arithmetic execution, the sum in FIG. 22(c) of the density values of the respective pixels and allocation error value G20 of the previous pixel is “600.” Here, when the gradation unit Cn is allocated to the position of respective pixels, the number of allocations which means how many times the gradation unit Cn is allocated to the position of respective pixels is “7” and residual G21 is “5” because gradation unit Cn is “85.”
On the basis of the calculation, re-allocation means G9 carries out density re-allocation as follows. That is, since the number of allocations is “7” and is larger than the number “4” of pixels in the window, four pieces of “85” are first allocated as shown in FIG. 22(d), and then the remaining three pieces of “85” are allocated in as shown in FIG. 22(e). If the values thus allocated of the pixels are added up, re-allocation values are obtained as shown in FIG. 22(f).
But the problem with the method disclosed in Japanese Patent Publicized Gazette No. 7-93684 is that multi-leveled letters and line drawings get blur in the edge as shown in FIG. 23 though no such problem is encountered with bi-levels.
If the inputted value at the lower right in FIG. 23(a) is “0” under the same conditions as in FIG. 22, the re-allocation values finally obtained will be as in FIG. 23(f). In this case, residual G21 is a value “20.” Image patterns as shown in FIG. 23 tend to occur in the edges of letters and line drawings. The inputted value at the lower right would be 0 and the re-allocation value “85,” which means that the density rises with the image blurred.